/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Menu;

import GUI.TimKiem.JIFTimDichVu;
import GUI.TimKiem.JIFTimKhach;
import GUI.TimKiem.JIFTimMonAn;
import GUI.TimKiem.JIFTimPhong;
import javax.swing.JDesktopPane;

/**
 *
 * @author Mr
 */
public class JIFTimKiem extends javax.swing.JInternalFrame {
    private JDesktopPane desktop;

    /**
     * Creates new form JIFTimKiem
     */
    public JIFTimKiem() {
        javax.swing.plaf.InternalFrameUI gui  = this.getUI();  
            ((javax.swing.plaf.basic.BasicInternalFrameUI)gui).setNorthPane(null);
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        btTimKhach = new javax.swing.JButton();
        btTimPhong = new javax.swing.JButton();
        btTimMonAn = new javax.swing.JButton();
        btTimDichVu = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 51, 204), 3));

        btTimKhach.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/timkhach.png"))); // NOI18N
        btTimKhach.setText("Tìm Kiếm Khách");
        btTimKhach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTimKhachActionPerformed(evt);
            }
        });

        btTimPhong.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/find.png"))); // NOI18N
        btTimPhong.setText("Tìm Kiếm Phòng");
        btTimPhong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTimPhongActionPerformed(evt);
            }
        });

        btTimMonAn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/timmon.png"))); // NOI18N
        btTimMonAn.setText("Tìm Kiếm Món Ăn");
        btTimMonAn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTimMonAnActionPerformed(evt);
            }
        });

        btTimDichVu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/timdv.png"))); // NOI18N
        btTimDichVu.setText("Tìm Kiếm Dịch Vụ");
        btTimDichVu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTimDichVuActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setText("TÌM KIẾM");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel1)
                .addGap(32, 32, 32)
                .addComponent(btTimPhong, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btTimKhach, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btTimMonAn, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btTimDichVu, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(8, 8, 8)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btTimMonAn, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btTimKhach, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btTimPhong, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btTimDichVu, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(8, 8, 8))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(21, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btTimPhongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTimPhongActionPerformed
        // TODO add your handling code here:
        if (getDesktop().getComponentCount() != 0) {
            getDesktop().getComponent(0).setVisible(false);
        }
        getDesktop().removeAll();
        JIFTimPhong frame;

        try {
            frame = new JIFTimPhong();
            frame.setVisible(true);
            frame.setSelected(true);
            getDesktop().add(frame);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btTimPhongActionPerformed

    private void btTimKhachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTimKhachActionPerformed
        // TODO add your handling code here:
        if (getDesktop().getComponentCount() != 0) {
            getDesktop().getComponent(0).setVisible(false);
        }
        getDesktop().removeAll();
        JIFTimKhach frame;

        try {
            frame = new JIFTimKhach();
            frame.setVisible(true);
            frame.setSelected(true);
            getDesktop().add(frame);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btTimKhachActionPerformed

    private void btTimMonAnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTimMonAnActionPerformed
        // TODO add your handling code here:
        if (getDesktop().getComponentCount() != 0) {
            getDesktop().getComponent(0).setVisible(false);
        }
        getDesktop().removeAll();
        JIFTimMonAn frame;

        try {
            frame = new JIFTimMonAn();
            frame.setVisible(true);
            frame.setSelected(true);
            getDesktop().add(frame);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btTimMonAnActionPerformed

    private void btTimDichVuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTimDichVuActionPerformed
        // TODO add your handling code here:
        if (getDesktop().getComponentCount() != 0) {
            getDesktop().getComponent(0).setVisible(false);
        }
        getDesktop().removeAll();
        JIFTimDichVu frame;

        try {
            frame = new JIFTimDichVu();
            frame.setVisible(true);
            frame.setSelected(true);
            getDesktop().add(frame);
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btTimDichVuActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btTimDichVu;
    private javax.swing.JButton btTimKhach;
    private javax.swing.JButton btTimMonAn;
    private javax.swing.JButton btTimPhong;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }

    /**
     * @return the desktop
     */
    public JDesktopPane getDesktop() {
        return desktop;
    }
}
